package com.wva.common.client;

import com.wva.common.domain.dto.PictureCaptchaVerifyDTO;
import com.wva.common.domain.dto.SmsCaptchaVerifyDTO;
import com.wva.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * TODO 内部调用失败的处理 fallbackFactory = ItemClientFallbackFactory.class
 */
@FeignClient(value = "captcha-service")
public interface CaptchaClient {
    /**
     * 校验图形验证码RPC接口
     * @param pictureCaptchaVerifyDTO
     * @return
     */
    @PostMapping("/captcha/verify/picture")
    R<Object> verifyPictureCaptcha(@RequestBody PictureCaptchaVerifyDTO pictureCaptchaVerifyDTO);

    /**
     * 校验短信验证码RPC接口
     * @param smsCaptchaVerifyDTO
     * @return
     */
    @PostMapping("/captcha/verify/sms")
    R<Object> verifySmsCaptcha(@RequestBody SmsCaptchaVerifyDTO smsCaptchaVerifyDTO);
}
